﻿//===================================================================
// 项目名称  
// 模块名称：配送管理
// 类    名：
//===================================================================
// 历史：
// Date        Modified_By  Reason      Description 
// 2009/11/02    刘亮        创建         废烟支管理

//===================================================================
//  Copyright (c) 2009-2010   
//===================================================================

var form1 = {
    type  : "form", 
    name  : "search",   
    title : "查询条件",
    
    isSearch : true,            
    items : [
            
           
            {
                type:"calendar",
                title:"开始日期",
                // url:"../data/MoistureOvenCheckView5.txt" ,
                root:"dataset.simplecombobox"
            },
			 {
                type:"calendar",
                title:"结束日期",
                // url:"../data/MoistureOvenCheckView5.txt" ,
                root:"dataset.simplecombobox"
            },
			{ 
                type:"combox",
                title:"下级分销商或门店",                                         
                url:"data/dangwei.txt",
                root:"dataset.simplecombobox"                
            } ,
			{ 
                type:"combox",
                title:"资金形式",                                         
                url:"data/zijingxinshi.txt",
                root:"dataset.simplecombobox"                
            } 
    ],

   layoutConfig : 
    {
        columns : 4
    },
    layout : 
	[
		{
		items:
			[
				{'name':'开始日期'}, 
				{'name':'结束日期'}, 
				{'name':'下级分销商或门店'},
				{'name':'资金形式'}  
			]
		}
    ]
};

//=======================================================================================
//定义一个静态列表表单对象 grid1
//=======================================================================================
var grid1 = {
    "name"      : "普通列表1",
    "type"      : "grid",
    "title"     : "配送管理",
    colCheckbox : true,
    pageSize:4,
    "url"       : "data/peisong1.txt",

    "tbar"      : [
        {text: '新增'}, '-',
        {text: '删除'}
    ],
    "bindRelation"   : {
        "root"  :"dataset.grid",
         id    : "pid",
        "col"   :[  
            {"header":"配送日期",  "width":100, "align":"left",  "dataIndex":"F1"},    
            {"header":"下级分销商或门店",  "width":100, "align":"left",  "dataIndex":"F2"},
            {"header":"资金形式",  "width":100, "align":"left",  "dataIndex":"F3"},     
            {"header":"经手人",    "width":100, "align":"left",  "dataIndex":"F4"},     
            {"header":"备注",      "width":100, "align":"left",  "dataIndex":"F5"},
            {"header":"修改",      "actionCol" :true },    
            {"header":"查看",      "actionCol" :true }
        ]
        
    }
};
var grid2 = {
    "name"      : "普通列表2",
    "type"      : "grid",
    "title"     : "配送明细",
    "url"       : "data/peisong2.txt",
    haveCheckCol: true,
       "bindRelation"   : {
        "root"  :"dataset.grid",
        id   : "pid",
        "col"   :[     
            {"header":"产品名称",  "width":100, "align":"left",  "dataIndex":"F1"},      
            {"header":"型号规格",  "width":100, "align":"left",  "dataIndex":"F2"},
            {"header":"供给形式",  "width":100, "align":"left",  "dataIndex":"F3"},
            {"header":"单价",      "width":100, "align":"left",  "dataIndex":"F4"},
            {"header":"数量",      "width":100, "align":"left",  "dataIndex":"F5"},
            {"header":"金额",      "width":100, "align":"left",  "dataIndex":"F6"}
        ]
        
    }
};

var page1 = new Sail.page({
    id : "page_001",
    haveNavi:true,
        localNaviText : "您的位置：仓库管理>配送管理",
    frames : {
        name   : "RollStandardList",
        title  : "标题",
        autoLoad : false,
        items  : [form1,grid1,grid2],
      
        afterCreateWidgets : function(){
           
        },
        
        bindEvent2Items : function(){
           var sendData = {};
           var isFlag ;
           var grid1 = this.getItem('普通列表1'); 
           var obj_form = $("search");
           grid1.getButton('新增').on('click',function(){
                Sail.open("peisongUpdate.html","add",sendData,800,600);
               });          
						
			
        
       }
       
    },
    afterRun : function(){
        
    }
});

page1.run();

    